package net.ojbk.study.twobox.beans.form.query;

import net.ojbk.study.twobox.beans.form.InputItem;
import net.ojbk.study.twobox.beans.po.Staff;
import net.ojbk.study.twobox.beans.vo.SelectOption;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/4/14
 * Time: 17:29
 * Description: No Description
 */
@Component
public class StaffQueryForm extends SupperQueryForm<Staff> {

    private InputItem inputItemPost = new InputItem("职务",
            "postid",
            "0", "select", null);

    public StaffQueryForm() {
        this.inputItems.add(new InputItem("员工名称",
                "staffname",
                "",
                "text"));
        this.inputItems.add(inputItemPost);
        List<SelectOption> sexList = new ArrayList<>();
        sexList.add(new SelectOption("男", "男"));
        sexList.add(new SelectOption("女", "女"));
        this.inputItems.add(
                new InputItem("性别",
                        "gender",
                        "男", "select",
                        sexList));


    }

    @Override
    public List<InputItem> getInputItems() throws Exception {
        inputItemPost.setOther(this.selectOptionUtil.getSelectOptionListByName("post"));
        return super.getInputItems();
    }
}
